/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fss.remote;

import fss.common.communication.DownloadRequest;
import fss.common.communication.QueryResult;
import fss.common.communication.UploadRequest;
import fss.core.config.FssProperties;
import fss.remote.util.RemoteFileServiceClient;
import fss.transfer.TransferId;
import fss.util.FssUtils;
import fss.util.rmi.RmiId;
import java.rmi.RemoteException;
import java.util.List;
import java.util.logging.Logger;

/**
 *
 * @author hieu
 */
public class ClientRemoteObject implements RemoteClient, RemoteFileServiceClient
{

  public ClientRemoteObject(RmiId aId)
  {
    mId = aId;
    homedir = FssProperties.getInstance().getClientHomeDir(mId.getName());
    datadir = homedir + DATA_DIR;
    FssUtils.createDirectory(homedir);
    FssUtils.createDirectory(datadir);
  }

  public Logger getLogger()
  {
    return logger;
  }

  @Override
  public void update(Object observable, Object message) throws RemoteException
  {
    //TODO
  }

  @Override
  public RmiId getId() throws RemoteException
  {
    return mId;
  }

  @Override
  public void stop() throws RemoteException
  {
    throw new UnsupportedOperationException("Not supported yet.");
  }

  @Override
  public void start() throws RemoteException
  {
    throw new UnsupportedOperationException("Not supported yet.");
  }
  private static final long serialVersionUID = 1L;
  private RmiId mId;
  private RmiId mServiceId;
  private static final String DATA_DIR = "/data";
  private static Logger logger;
  private String homedir = null;
  private String datadir = null;
@Override
public void upload(UploadRequest request) throws RemoteException {
    // TODO Auto-generated method stub
    
}

@Override
public void download(DownloadRequest request) throws RemoteException {
    // TODO Auto-generated method stub
    
}

@Override
public List<QueryResult> query(RmiId registryId, String param)
        throws RemoteException {
    // TODO Auto-generated method stub
    return null;
}

@Override
public void resume(TransferId transferId) throws RemoteException {
    // TODO Auto-generated method stub
    
}

}
